<!-- <html>
    <div>hello javascript</div>
    <div>hello BOM</div>
    <div>hello DOM</div>
    <script>
        var divs = document.getElementsByTagName("div");
        for (i = 0; i < divs.length; i++) {
            document.write(divs[i]);
            document.write("<br>");
        }
    </script>
</html> -->

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    </head>
    <script src="jquery.min.js"></script>
    <script>
        $(function(){
            $("#b1").click(function() {
                $("#d").hide()
            });
            $("#b2").click(function(){
                $("d").show()
            });
            $("#b3").click(function(){
                alert("点击了按钮");
            });
            $("#b4").click(function(){
                alert($("#input1").val())
            });
            $("#b5").click(function(){
                alert($("#d2").html());
            });
            $("#b6").click(function(){
               alert($("#d2").text());
            });
        })

    </script>
    <button id="b1">隐藏div</button>
    <button id="b2">显示div</button>
    <button id="b4">取值</button>
    <br>
    <br>
    <div id="d">
        这是一个div
    </div>
    <br>
    <input type="text" name="" id="input1" value="默认值">
    <button id="b3">弹出框</button>
    <button id="b5">获取元素内容,包含子标签</button>
    <button id="b6">获取元素内容,不包含子标签</button>
    <br>
    <div id="d2">这是div内容<span>div里包含一个span元素</span></div>

</html>